﻿using System.Text.Json.Serialization;

namespace llm_project.Models
{
    internal class EmbeddingResult
    {
        [JsonPropertyName("data")]
        public List<EmbeddingData> Data { get; set; }

        // 如果 JSON 中还有其他字段，也需要正确映射
        [JsonPropertyName("model")]
        public string Model { get; set; }

        [JsonPropertyName("usage")]
        public UsageData Usage { get; set; }
    }

    internal class EmbeddingData
    {
        [JsonPropertyName("embedding")]
        public List<float> Embedding { get; set; }

        [JsonPropertyName("index")]
        public int Index { get; set; }
    }

    internal class UsageData
    {
        [JsonPropertyName("prompt_tokens")]
        public int PromptTokens { get; set; }

        [JsonPropertyName("total_tokens")]
        public int TotalTokens { get; set; }
    }
}
